package me.jessyan.armscomponent.app.mvp.model.api.service;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import me.jessyan.armscomponent.app.mvp.model.entity.Question;
import me.jessyan.armscomponent.app.mvp.model.entity.QuestionRequest;
import me.jessyan.armscomponent.app.mvp.model.entity.QuestionSubmitRequest;
import me.jessyan.armscomponent.app.mvp.model.entity.RetrievePasswordRequest;
import me.jessyan.armscomponent.commonsdk.http.BaseResponse;
import me.jessyan.armscomponent.app.mvp.model.entity.AddressEntity;
import me.jessyan.armscomponent.app.mvp.model.entity.LoginRequest;
import me.jessyan.armscomponent.app.mvp.model.entity.ModifyRequest;
import me.jessyan.armscomponent.app.mvp.model.entity.RegisterRequest;
import me.jessyan.armscomponent.commonsdk.core.User;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;

/**
 * Desc: 用户相关接口
 * Created by taoze
 * on 2021/9/20
 **/
public interface UserService {

    /**
     * 用户注册
     */
//    @Headers({DOMAIN_NAME_HEADER + Api.APP_DOMAIN})
    @POST("app/user/register")
    Observable<BaseResponse<Object>> register(@Body RegisterRequest registerRequest);

    /**
     * 检查手机号是否注册
     */
    @POST("app/user/checkMobile")
    Observable<BaseResponse<Object>> checkMobile(@Body Map<String,String> map);

    /**
     * 用户登录
     */
    @POST("app/user/login")
    Observable<BaseResponse<User>> login(@Body LoginRequest loginRequest);

    /**
     * 忘记密码登录
     */
    @PUT("app/user/forgetLoginPwd")
    Observable<BaseResponse<Object>> forgetLoginPwd(@Body RetrievePasswordRequest loginRequest);

    /**
     * 获取短信验证码
     */
    @POST("app/user/smsCaptcha")
    Observable<BaseResponse<Object>> smsCaptcha(@Body Map<String, String> map);

    /**
     * 获取图片验证码
     */
    @GET("app/user/imgCaptcha")
    Observable<ResponseBody> imgCaptcha();

    /**
     * 校验图片验证码
     */
    @POST("app/user/checkImgCaptcha")
    Observable<BaseResponse<Object>> checkImgCaptcha(@Body Map<String, String> map);


    /**
     * 获取邮箱验证码
     */
    @GET("app/user/emailCaptcha")
    Observable<BaseResponse<Object>> emailCaptcha(@Body Map<String, String> map);

    /**
     * 获取调查问卷
     */
    @GET("app/user/questionnaire")
    Observable<BaseResponse<List<Question>>> questionnaire();

    /**
     * 提交调查问卷
     */
    @PUT("app/user/questionnaire")
    Observable<BaseResponse<Object>> questionnaireSubmit(@Body QuestionSubmitRequest answers);

    /**
     * 获取个人资料
     */
    @GET("app/user/info")
    Observable<BaseResponse<User>> info();

    /**
     * 更新用户信息
     */
    @PUT("app/user/info")
    Observable<BaseResponse<Object>> updateUser(@Body User user);

    /**
     * 修改登录密码
     */
    @PUT("app/user/loginPwd")
    Observable<BaseResponse<Object>> modifyLoginPwd(@Body ModifyRequest modifyRequest);


    /**
     * 修改手机号
     */
    @PUT("app/user/mobile")
    Observable<BaseResponse<Object>> modifyMobile(@Body ModifyRequest modifyRequest);

    /**
     * 修改邮箱
     */
    @PUT("app/user/email")
    Observable<BaseResponse<Object>> modifyEmail(@Body ModifyRequest modifyRequest);
    /**
     * 获取实名信息
     */
    @GET("app/user/realName")
    Observable<BaseResponse<User>> getRealName();

    /**
     * 修改实名信息
     */
    @PUT("app/user/realName")
    Observable<BaseResponse<Object>> modifyRealName(@Body ModifyRequest modifyRequest);

    /**
     * 创建收货地址
     */
    @POST("app/user/shippingAddr")
    Observable<BaseResponse<Object>> addShippingAddr(@Body ModifyRequest modifyRequest);

    /**
     * 获取收获地址列表
     */
    @GET("app/user/shippingAddrList")
    Observable<BaseResponse<AddressEntity>> getShippingAddrList();

    /**
     * 获取收货地址详情
     */
    @PUT("app/user/shippingAddrDetail")
    Observable<BaseResponse<Object>> getShippingAddrDetail(@Body AddressEntity addressEntity);

    /**
     * 删除收获地址
     */
    @DELETE("app/user/shippingAddr")
    Observable<BaseResponse<Object>> deleteShippingAddr(@Body AddressEntity addressEntity);

    /**
     * 修改登录密码
     */
    @PUT("app/user/shippingAddr")
    Observable<BaseResponse<Object>> modifyShippingAddr(@Body ModifyRequest modifyRequest);

}
